<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript">
        EvPNG.fix('div, ul, img, li, input, a');
    </script>
    <![endif]-->

    <title>三十</title>
</head>
<body>
<div id="myVue">
    <!--Begin Header Begin-->
    <div class="soubg">
        <div class="sou">
            <!--Begin 所在收货地区 Begin-->
            <span class="s_city_b">
        	<span class="fl">送货至：</span>
            <span class="s_city">
            	<span>四川</span>
                <div class="s_city_bg">
                	<div class="s_city_t"></div>
                    <div class="s_city_c">
                    	<h2>请选择所在的收货地区</h2>
                        <table border="0" class="c_tab" style="width:235px; margin-top:10px;" cellspacing="0"
                               cellpadding="0">
                          <tr>
                            <th>A</th>
                            <td class="c_h"><span>安徽</span><span>澳门</span></td>
                          </tr>
                          <tr>
                            <th>B</th>
                            <td class="c_h"><span>北京</span></td>
                          </tr>
                          <tr>
                            <th>C</th>
                            <td class="c_h"><span>重庆</span></td>
                          </tr>
                          <tr>
                            <th>F</th>
                            <td class="c_h"><span>福建</span></td>
                          </tr>
                          <tr>
                            <th>G</th>
                            <td class="c_h"><span>广东</span><span>广西</span><span>贵州</span><span>甘肃</span></td>
                          </tr>
                          <tr>
                            <th>H</th>
                            <td class="c_h"><span>河北</span><span>河南</span><span>黑龙江</span><span>海南</span><span>湖北</span><span>湖南</span></td>
                          </tr>
                          <tr>
                            <th>J</th>
                            <td class="c_h"><span>江苏</span><span>吉林</span><span>江西</span></td>
                          </tr>
                          <tr>
                            <th>L</th>
                            <td class="c_h"><span>辽宁</span></td>
                          </tr>
                          <tr>
                            <th>N</th>
                            <td class="c_h"><span>内蒙古</span><span>宁夏</span></td>
                          </tr>
                          <tr>
                            <th>Q</th>
                            <td class="c_h"><span>青海</span></td>
                          </tr>
                          <tr>
                            <th>S</th>
                            <td class="c_h"><span>上海</span><span>山东</span><span>山西</span><span
                                    class="c_check">四川</span><span>陕西</span></td>
                          </tr>
                          <tr>
                            <th>T</th>
                            <td class="c_h"><span>台湾</span><span>天津</span></td>
                          </tr>
                          <tr>
                            <th>X</th>
                            <td class="c_h"><span>西藏</span><span>香港</span><span>新疆</span></td>
                          </tr>
                          <tr>
                            <th>Y</th>
                            <td class="c_h"><span>云南</span></td>
                          </tr>
                          <tr>
                            <th>Z</th>
                            <td class="c_h"><span>浙江</span></td>
                          </tr>
                        </table>
                    </div>
                </div>
            </span>
        </span>
            <!--End 所在收货地区 End-->
            <span class="fr">
                <span class="fl"><span v-if="loginUser.loginName===''">你好，请<a href="Login.html">登录</a>&nbsp; </span><span v-else>欢迎：<span style="font-weight: bolder;color: #ff3600">{{loginUser.loginName}}</span>&nbsp;&nbsp;</span><a v-if="loginUser.loginName!==''" href="#" @click.prevent="loginOut()">注销</a> <a
                        href="Regist.html" style="color:#ff4e00;">免费注册</a>&nbsp;|&nbsp;<a
                        href="Member_Order.html">我的订单</a>&nbsp;|</span>
        	<span class="ss">
                <div class="ss_list">
                	<a href="#">管理中心</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="Member_Safe.html">账户管理</a></li>
                                <li><a href="NewsList.html">资讯列表</a></li>
                                <li><a href="ProductList.html">商品列表</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="ss_list">
                	<a href="#">网站导航</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                            <ul>
                                <li><a href="Member_Collect.html">我的收藏</a></li>
                                <li><a href="CategoryList.html">全部商品</a></li>
                                <li><a href="BuyCar.html">购物车</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="images/s_tel.png" align="absmiddle"/></a></span>
        </span>
        </div>
    </div>
    <div class="top">
        <div class="logo"><a href="Index.html"><img src="images/logo.png"/></a></div>
        <div class="search">
            <form>
                <input type="text" value="" class="s_ipt"/>
                <input type="submit" value="搜索" class="s_btn"/>
            </form>
        </div>
        <div class="i_car">
            <div class="car_t">购物车 [ <span>{{car.totalNum}}</span> ]</div>
            <div class="car_bg">
                <!--Begin 购物车未登录 Begin-->
                <div v-if="loginUser.loginName==''" class="un_login">还未登录！<a href="Login.html"
                                                                                 style="color:#ff4e00;">马上登录</a>
                    查看购物车！
                </div>
                <!--End 购物车未登录 End-->
                <!--Begin 购物车已登录 Begin-->
                <div v-else-if="car.totalPrice==0" class="un_login">暂无商品！<a href="CategoryList.html"
                                                                                style="color:#ff4e00;">购买商品</a>
                </div>
                <div v-else>
                    <ul class="cars">
                        <li v-for="carDetail in carDetailList">
                            <div class="img"><a href="#"><img
                                    :src="'http://192.168.126.132:8090/easyBuy/files/'+carDetail.fileName" width="58"
                                    height="58"/></a></div>
                            <div class="name"><a href="#">{{carDetail.productName}}</a></div>
                            <div class="price"><font color="#ff4e00">￥{{ carDetail.totalPrice }}</font>
                                X{{ carDetail.totalNum }}
                            </div>
                        </li>

                    </ul>
                    <div class="price_sum">共计&nbsp; <font color="#ff4e00">￥</font><span>{{car.totalPrice}}</span>
                    </div>
                    <div class="price_a"><a :href="'BuyCar.html?id='+car.id">去购物车结算</a></div>
                    <!--End 购物车已登录 End-->
                </div>
            </div>
        </div>
    </div>
    <!--End Header End-->
    <!--Begin Menu Begin-->
    <div class="menu_bg">
        <div class="menu">
            <!--Begin 商品分类详情 Begin-->
            <div class="nav">
                <div class="nav_t"><a href="Index.html" style="color: white;font-size: 16px">首页</a></div>
                <div class="leftNav none">
                    <ul>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav1.png"/></span>
                                <span class="fl">进口食品、生鲜</span>
                            </div>
                            <div class="zj">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav2.png"/></span>
                                <span class="fl">食品、饮料、酒</span>
                            </div>
                            <div class="zj" style="top:-40px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力2</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav3.png"/></span>
                                <span class="fl">母婴、玩具、童装</span>
                            </div>
                            <div class="zj" style="top:-80px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力3</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav4.png"/></span>
                                <span class="fl">家居、家庭清洁、纸品</span>
                            </div>
                            <div class="zj" style="top:-120px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力4</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav5.png"/></span>
                                <span class="fl">美妆、个人护理、洗护</span>
                            </div>
                            <div class="zj" style="top:-160px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力5</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav6.png"/></span>
                                <span class="fl">女装、内衣、中老年</span>
                            </div>
                            <div class="zj" style="top:-200px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力6</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav7.png"/></span>
                                <span class="fl">鞋靴、箱包、腕表配饰</span>
                            </div>
                            <div class="zj" style="top:-240px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力7</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav8.png"/></span>
                                <span class="fl">男装、运动</span>
                            </div>
                            <div class="zj" style="top:-280px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力8</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav9.png"/></span>
                                <span class="fl">手机、小家电、电脑</span>
                            </div>
                            <div class="zj" style="top:-320px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力9</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="fj">
                                <span class="n_img"><span></span><img src="images/nav10.png"/></span>
                                <span class="fl">礼品、充值</span>
                            </div>
                            <div class="zj" style="top:-360px;">
                                <div class="zj_l">
                                    <div class="zj_l_c">
                                        <h2>零食 / 糖果 / 巧克力10</h2>
                                        <a href="#">坚果</a>|<a href="#">蜜饯</a>|<a href="#">红枣</a>|<a
                                            href="#">牛肉干</a>|<a href="#">巧克力</a>|
                                        <a href="#">口香糖</a>|<a href="#">海苔</a>|<a href="#">鱼干</a>|<a
                                            href="#">蜜饯</a>|<a href="#">红枣</a>|
                                        <a href="#">蜜饯</a>|<a href="#">红枣</a>|<a href="#">牛肉干</a>|<a
                                            href="#">蜜饯</a>|
                                    </div>
                                </div>
                                <div class="zj_r">
                                    <a href="#"><img src="images/n_img1.jpg" width="236" height="200"/></a>
                                    <a href="#"><img src="images/n_img2.jpg" width="236" height="200"/></a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <!--End 商品分类详情 End-->
            <div class="m_ad">中秋送好礼！</div>
        </div>
    </div>
    <!--End Menu End-->
    <div class="i_bg">
        <div class="content mar_20">
            <img src="images/img1.jpg"/>
        </div>
        <div v-if="car.totalNum==0"><p style="font-size: 18px;font-weight: bolder;text-align: center">暂无数据</p></div>
        <!--Begin 第一步：查看购物车 Begin -->
        <div class="content mar_20" v-else>
            <table border="0" class="car_tab" style="width:1200px; margin-bottom:50px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="car_th" width="100">添加购物车</td>
                    <td class="car_th" width="490">商品名称</td>
                    <td class="car_th" width="150">购买数量</td>
                    <td class="car_th" width="130">小计</td>
                    <td class="car_th" width="150">操作</td>
                </tr>
                <tr v-for="carDetail in carDetailList">
                    <td>
                        <input type="checkbox" @change="checkboxOnchange($event)" v-model="selectProductId"
                               :value="carDetail.productId"/>
                    </td>
                    <td>
                        <div class="c_s_img"><img :src="'http://192.168.126.132:8090/easyBuy/files/'+carDetail.fileName"
                                                  width="73" height="73"/></div>
                        {{carDetail.productName}}
                    </td>
                    <td align="center">
                        <div class="c_num">
                            <input type="button" @click="changeProductNum(carDetail.productId,'sub')"
                                   class="car_btn_1"/>
                            <input type="text" @input="inputNum($event,carDetail.productId)"
                                   v-model="carDetail.totalNum"
                                   name="" class="car_ipt"/>
                            <input type="button" @click="changeProductNum(carDetail.productId,'add')"
                                   class="car_btn_2"/>
                        </div>
                    </td>
                    <td align="center" style="color:#ff4e00;">￥{{carDetail.totalPrice}}</td>
                    <td align="center"><a href="#" @click.prevent="toDel(carDetail.productId)">删除</a>&nbsp; &nbsp;<a
                            href="#" @click.prevent="addLike(carDetail.productId)">加入收藏</a></td>
                </tr>
                <tr height="70">
                    <td colspan="6" style="font-family:'Microsoft YaHei'; border-bottom:0;">
                        <label class="r_rad"><input type="button" @click="selectAllProduct()" value="全选"
                                                    name="clear"/>&nbsp;&nbsp;<input type="button"
                                                                                     @click="clearProduct()"
                                                                                     value="取消全选"
                                                                                     name="clear"/></label><label
                            class="r_txt"></label>
                        <span class="fr">商品总价：<b style="font-size:22px; color:#ff4e00;">￥{{totalPrice}}</b></span>
                    </td>
                </tr>
                <tr valign="top" height="150">
                    <td colspan="6" align="right">
                        <a href="#" @click.prevent="goCategoryList()"><img src="images/buy1.gif"/></a>&nbsp; &nbsp;
                        <a href="#" @click.prevent="goBuy()"><img src="images/buy2.gif"/></a>
                    </td>
                </tr>
            </table>
        </div>
        <!--End 第一步：查看购物车 End-->


        <!--Begin 弹出层-删除商品 Begin-->
        <div id="fade" class="black_overlay"></div>
        <div id="MyDiv" class="white_content">
            <div class="white_d">
                <div class="notice_t">
                    <span class="fr" style="margin-top:10px; cursor:pointer;" onclick="CloseDiv('MyDiv','fade')"><img
                            src="images/close.gif"/></span>
                </div>
                <div class="notice_c">

                    <table border="0" align="center" style="font-size:16px;" cellspacing="0" cellpadding="0">
                        <tr valign="top">
                            <td>您确定要把该商品移除购物车吗？</td>
                        </tr>
                        <tr height="50" valign="bottom">
                            <td><a href="#" class="b_sure">确定</a><a href="#" class="b_buy">取消</a></td>
                        </tr>
                    </table>

                </div>
            </div>
        </div>
        <!--End 弹出层-删除商品 End-->


        <!--Begin Footer Begin -->
        <div class="b_btm_bg bg_color">
            <div class="b_btm">
                <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
                       cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="72"><img src="images/b1.png" width="62" height="62"/></td>
                        <td><h2>正品保障</h2>正品行货 放心购买</td>
                    </tr>
                </table>
                <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
                       cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="72"><img src="images/b2.png" width="62" height="62"/></td>
                        <td><h2>满38包邮</h2>满38包邮 免运费</td>
                    </tr>
                </table>
                <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
                       cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="72"><img src="images/b3.png" width="62" height="62"/></td>
                        <td><h2>天天低价</h2>天天低价 畅选无忧</td>
                    </tr>
                </table>
                <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;"
                       cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="72"><img src="images/b4.png" width="62" height="62"/></td>
                        <td><h2>准时送达</h2>收货时间由你做主</td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="b_nav">
            <dl>
                <dt><a href="#">新手上路</a></dt>
                <dd><a href="#">售后流程</a></dd>
                <dd><a href="#">购物流程</a></dd>
                <dd><a href="#">订购方式</a></dd>
                <dd><a href="#">隐私声明</a></dd>
                <dd><a href="#">推荐分享说明</a></dd>
            </dl>
            <dl>
                <dt><a href="#">配送与支付</a></dt>
                <dd><a href="#">货到付款区域</a></dd>
                <dd><a href="#">配送支付查询</a></dd>
                <dd><a href="#">支付方式说明</a></dd>
            </dl>
            <dl>
                <dt><a href="#">会员中心</a></dt>
                <dd><a href="#">资金管理</a></dd>
                <dd><a href="#">我的收藏</a></dd>
                <dd><a href="#">我的订单</a></dd>
            </dl>
            <dl>
                <dt><a href="#">服务保证</a></dt>
                <dd><a href="#">退换货原则</a></dd>
                <dd><a href="#">售后服务保证</a></dd>
                <dd><a href="#">产品质量保证</a></dd>
            </dl>
            <dl>
                <dt><a href="#">联系我们</a></dt>
                <dd><a href="#">网站故障报告</a></dd>
                <dd><a href="#">购物咨询</a></dd>
                <dd><a href="#">投诉与建议</a></dd>
            </dl>
            <div class="b_tel_bg">
                <a href="#" class="b_sh1">新浪微博</a>
                <a href="#" class="b_sh2">腾讯微博</a>
                <p>
                    服务热线：<br/>
                    <span>400-123-4567</span>
                </p>
            </div>
            <div class="b_er">
                <div class="b_er_c"><img src="images/er.gif" width="118" height="118"/></div>
                <img src="images/ss.png"/>
            </div>
        </div>
        <div class="btmbg">
            <div class="btm">
                备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018 尤洪商城网 All Rights
                Reserved. 复制必究 , Technical Support: Dgg Group <br/>
                <img src="images/b_1.gif" width="98" height="33"/><img src="images/b_2.gif" width="98" height="33"/><img
                    src="images/b_3.gif" width="98" height="33"/><img src="images/b_4.gif" width="98" height="33"/><img
                    src="images/b_5.gif" width="98" height="33"/><img src="images/b_6.gif" width="98" height="33"/>
            </div>
        </div>
        <!--End Footer End -->
    </div>
</div>

<script type="text/javascript" src="js/axios.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript">
    const myVue = new Vue({
        el: '#myVue',
        data: {
            totalPrice: 0,
            selectProductId: [],
            carDetailList: [],
            car: '',
            loginUser: {
                userId: "-1",
                loginName: ''
            },
        },
        methods: {
            loginOut: function () {
                window.sessionStorage.clear();
                axios({
                    url:'/api/user/exit'
                }).then(rs=>{
                    if (rs.data.code===200){
                        alert("注销成功!")
                    }else {
                        alert("注销失败！")
                    }
                })
            },
            addLike: function (id) {
                if (myVue.loginUser.loginName === '') {
                    alert("请登录！")
                    return;
                }
                axios({
                    url: '/api/product/getPro',
                    params: {
                        id
                    }
                }).then(function (rs) {
                    axios({
                        url: '/api/like/addLike',
                        params: {
                            loginName: myVue.loginUser.loginName,
                            productId: rs.data.product.id,
                            productName: rs.data.product.name,
                            fileName: rs.data.product.fileName,
                            price: rs.data.product.price,
                            stock: rs.data.product.stock,
                        }
                    }).then(function (rs) {
                        if (rs.data.code === 200) {
                            alert("添加成功！")
                        } else {
                            alert("添加失败！")
                        }
                    })
                })
            },
            toDel: function (productId) {
                const isGo = window.confirm("是否确认删除id为" + productId + "的商品？")
                if (!isGo) {
                    return;
                }
                axios({
                    url: '/api/car/delCar',
                    params: {
                        productId,
                        loginName: this.loginUser.loginName
                    }
                }).then(rs => {
                    this.getCar()
                    this.checkboxOnchange();
                    if (rs.data.code === 200) {
                        alert("删除成功1")
                    }
                })
            },
            clearProduct: function () {
                this.selectProductId = [];
                this.checkboxOnchange();
            },
            selectAllProduct: function () {
                let array = [];
                for (carDetail in this.carDetailList) {
                    array.push(this.carDetailList[carDetail].productId)
                }
                this.selectProductId = array
                this.checkboxOnchange();
            },
            inputNum(event, id) {
                const num = event.target.value;
                axios({
                    url: '/api/product/getPro',
                    params: {
                        id
                    }
                }).then(rs => {
                    let stock=rs.data.product.stock;
                    for (carDetail in this.carDetailList) {
                        if (id === this.carDetailList[carDetail].productId) {
                            if (!/^\d+$/.test(num)) {
                                this.carDetailList[carDetail].totalNum = 1
                                this.carDetailList[carDetail].totalPrice = this.carDetailList[carDetail].price
                                return;
                            }
                            if (num >= stock) {
                                this.carDetailList[carDetail].totalNum = this.carDetailList[carDetail].stock
                                this.carDetailList[carDetail].totalPrice = this.carDetailList[carDetail].price * this.carDetailList[carDetail].stock
                            } else {
                                this.carDetailList[carDetail].totalNum = num;
                                this.carDetailList[carDetail].totalPrice = this.carDetailList[carDetail].price * this.carDetailList[carDetail].totalNum
                            }
                            this.checkboxOnchange();
                            return
                        }
                    }
                })

            },
            changeProductNum: function (id, opr) {
                axios({
                    url: '/api/product/getPro',
                    params: {
                        id
                    }
                }).then(rs => {
                    let stock=rs.data.product.stock;
                    for (carDetail in this.carDetailList) {
                        if (id === this.carDetailList[carDetail].productId) {
                            if (opr === 'add') {
                                if (this.carDetailList[carDetail].totalNum >= stock) {
                                    return;
                                }
                                this.carDetailList[carDetail].totalNum = this.carDetailList[carDetail].totalNum + 1
                                this.carDetailList[carDetail].totalPrice = this.carDetailList[carDetail].totalPrice + this.carDetailList[carDetail].price
                            } else {
                                if (this.carDetailList[carDetail].totalNum === 1) {
                                    return;
                                }
                                this.carDetailList[carDetail].totalNum = this.carDetailList[carDetail].totalNum - 1
                                this.carDetailList[carDetail].totalPrice = this.carDetailList[carDetail].totalPrice - this.carDetailList[carDetail].price
                            }
                            this.checkboxOnchange();
                            return
                        }
                    }
                })

            },
            goCategoryList: function () {
                window.location = 'CategoryList.html';
            },
            goBuy: function () {
                if (this.selectProductId.length === 0) {
                    alert("请选择商品！")
                    return;
                }
                let updateCarList = [];
                for (index in this.selectProductId) {
                    for (carDetail in this.carDetailList) {
                        if (this.selectProductId[index] === this.carDetailList[carDetail].productId) {
                            updateCarList.push(this.carDetailList[carDetail])
                        }
                    }
                }
                axios({
                    url: '/api/car/updateCar',
                    method: "POST",
                    data: {
                        loginName: this.loginUser.loginName,
                        updateCarList: JSON.stringify(updateCarList)
                    }
                }).then(rs => {
                    if (rs.data.code === 200) {
                        let arrayJson = JSON.stringify(this.selectProductId);
                        let encodedArrayJson = encodeURIComponent(arrayJson);
                        window.location = 'BuyCar_Two.html?arrayJson=' + encodedArrayJson;
                    }
                })
            },
            checkboxOnchange: function (event) {
                this.totalPrice = 0
                for (carDetail in this.carDetailList) {
                    for (pId in this.selectProductId) {
                        if (this.selectProductId[pId] === this.carDetailList[carDetail].productId) {
                            this.totalPrice = this.totalPrice + this.carDetailList[carDetail].totalPrice;
                        }
                    }
                }
            },
            getCar: function () {
                axios({
                    url: '/api/car/getCar',
                    params: {
                        loginName: this.loginUser.loginName
                    }
                }).then(rs => {
                    this.car = rs.data.car
                    this.carDetailList = [];
                    for (car in rs.data.carMap) {
                        this.carDetailList.push(rs.data.carMap[car]);
                    }
                })
            },
        },
        created: function () {
            let token = window.sessionStorage.getItem('token');
            if (token === '' || token === null) {
                console.log("未登录")
            } else {
                axios({
                    url: '/api/user/findUserFromRedis'
                }).then(rs => {
                    if (rs.data.code === 200) {
                        this.loginUser.userId = rs.data.user.id;
                        this.loginUser.loginName = rs.data.user.loginName;
                        this.getCar();
                    }
                })
            }
        }
    })
</script>
</body>
</html>
